<?php $news = $this->News->get($_GET['id']) ?>
<h1><?php echo $news['title'] ?></h1>
<?php echo $news['body'] ?>
<p class="news_date">Por <?php echo $news['author'] ?> em <?php echo $news['created'] ?></p>
<?php if ($news['display_comments']): ?>
	<h1>Coment&aacute;rios</h1>
	<?php if (empty($news['comments'])): ?>
		<div class="info"><div class="message">Nenhum coment&aacute;rio relacionado &agrave; esta not&iacute;cia.</div></div>
	<?php else: ?>
		<div id="comments">
            <ul class="comments">
                <?php foreach ($news['comments'] as $comment): ?>
                    <li>
                        <div class="avatar">
                            <?php echo $this->image($comment['avatar'], array('width' => 70, 'height' => 85)) ?>
                        </div>
                        <div class="text">
                            <p class="author"><?php echo $comment['author'] ?><span class="created"><?php echo $this->relative($comment['created']) ?></span></p>
                            <p><?php echo $this->filter($comment['body'], $this->Config->filter) ?></p>
                        </div>
                    </li>
                <?php endforeach ?>
            </ul>			
		</div>
	<?php endif ?>
	<?php if ($this->Auth->is_logged()): ?>
		<?php $characters = $this->Account->get_characters($this->Auth->logged()) ?>
		<?php if (!empty($characters)): ?>
            <h1>Deixe seu Coment&aacute;rio</h1>
            <div class="info">
                <form action="" method="post" id="post_comment">
                	<label>Personagem</label>
                    <select class="selectbox" name="character" id="character_select">
						<?php foreach ($characters as $character): ?>
                            <option value="<?php echo $character['name'] ?>"><?php echo $character['name'] ?></option>
                        <?php endforeach ?>
                    </select>
                    <label>Coment&aacute;rio</label>
                    <textarea id="comment" name="comment" class="textarea"></textarea>
                    <input type="hidden" name="news_id" value="<?php echo $_GET['id'] ?>" />
                    <input type="submit" value="Postar Coment&aacute;rio" class="input_submit" />
                </form>
            </div>
    	<?php endif ?>
	<?php endif ?>
<?php endif ?>